<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>购买会员卡</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<script src="__INDEX__/js/mui.min.js"></script>
	    <link href="__INDEX__/css/mui.min.css" rel="stylesheet"/>
		<link rel="stylesheet" href="__INDEX__/css/hykcz.css" />
	</head>
	<body class="czfa_content">
		<header class="mui-bar mui-bar-nav" >
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" ></a>
		    <h1 class="mui-title" >购买会员卡</h1>
		</header>
	<div class="mui-content xfjl_content">
			<ul class="hycz_list xhd_list">
			<!--购买数据-->
				{foreach name="level" item="l"}
				<li data-val="{$l.id}">
					<div class="left"><em>¥{$l.price}</em><p class="num"></p></div>
					<div class="right">
						<p class="name">{$l.name}</p>
						<p class="num" style="font-weight: bold;">赠送房券： {$l.zs_num}张&nbsp;</p>
						<!--<p class="num" style="font-size: 10px;">享受折扣 {$l.discount}折</p>
						<p class="num" style="font-size: 10px;">分享返利 {$l.rebate}%</p>-->
					</div>
				</li>
				{/foreach}
				
			</ul>
			<input type="hidden" id="page" value="1">
			<input type="hidden" id="agent_id" value="2">

			<div class="xhd_bottom">
				<a href="#" class="hyk_btn hycz_btn">立即购买</a>
				<div class="hycz_tip">购买说明：在购买会员卡之前请向商家咨询使用规则，<br>一经购买不支持退货，并请在有效期限内使用。</div>
			</div>

			<form method="post" id="my_form">
				<input type="hidden" name="level_id" id="level_id" >
			</form>

		</div>
	</body>
</html>
{include file="public/footer" /}
<script>
	$(".hycz_list li").click(function(){
		$(".active").removeClass("active");
		$(this).addClass("active");
		$("#level_id").val($(this).data('val'));
	})
	$(".hyk_btn").click(function(){
		var cz_money=$(".active").data("val");
		if(cz_money==undefined){
			layer.msg("请选择会员卡");
			return;
		}else{
//			if($('#checkbox').is(':checked')==false) {
//				    layer.msg('请阅读购买协议');
//				    return;
//			}
			var btnArray = ['不同意', '同意'];
				mui.confirm('确认购买！', '确认购买', btnArray, function(e) {
					 if (e.index == 1) {
					 	$("#my_form").submit();
					 }
			})
		}
		
	})
</script>
